<%
title = 'FAQs'
description = 'Frequently asked questions about using mountebank'
%>

<% include _header %>

      <h1>Frequently Asked Questions</h1>

      <dl>
        <dt>How do you pronounce mountebank?</dt>
        <dd>mountebank pronounces it with a plain and unpretentious accent,
        reflecting his humble roots as a man of the people.</dd>

        <dt>How can I post-process a response, for example, to add a custom header to
          a proxied response or add a current timestamp into the response</dt>
        <dd>See the <a href='/docs/api/behaviors'><code>decorate</code> behavior</a> for general purpose decoration.
            You can inject headers into proxied responses using the <a href='/docs/api/proxies#proxy-inject-headers'>
            <code>injectHeaders</code></a> field</dd>

        <dt>How can I split my imposters into multiple files and have them automatically
        loaded when <code>mb</code> restarts?</dt>
        <dd>See the <a href='/docs/commandLine#config-file'><code>--configfile</code> command line option</a>
        It can either be a single file containing the JSON that you get back when you call
        <a href='/docs/api/overview#get-imposters'><code>GET /imposters?replayable=true</code></a>
        or multiple files that will be collected via templating. Alternatively, starting <code>mb</code>
        with the <code>--datadir</code> command line option will load all previously saved imposters
        in the database.</dd>

        <dt>I'm adding mountebank as an npm dependency to my project. Why isn't npm shrinkwrap working?</dt>
        <dd>This is actually a npm issue, not a bug in mountebank. Mountebank is published using npm v3, which
            modifies the behavior of where npm dependencies are installed. npm v2 does not expect this, and will
            throw errors because of it when trying to shrinkwrap. Upgrading to npm v3 solves this issue.
            If for some reason you are stuck on npm v2, there is an only moderately inconvenient workaround.
            Add all of mountebanks top level dependencies to your own package.json. Then, between npm install
            and npm shrinkwrap, delete the node_modules/mountebank/node_modules folder. This workaround works
            for grunt-mountebank, if you are using that as well (thanks Adam Kalman for the explanation).</dd>

        <dt>I'm proxying to a server that returns gzipped (compressed) data, but I'd like to save the
        data uncompressed. Is there a way to do that?</dt>
        <dd>Yes! Using the <a href='/docs/api/proxies'><code>injectHeaders</code></a> field on the proxy,
        add an 'Accept-Encoding: identity' header. That's an HTTP-based way of the proxy client telling
        the server that it won't accept compressed data.</dd>

        <dt>Can I use mountebank for load testing?</dt>
        <dd>Yes, and field reports have indicated that mountebank may be the only open source
        service virtualization tool that performs under significant load. For any long-running process, make
        sure you run with the <code>--datadir</code> command line option so mountebank doesn't leak memory
        during proxy recording or saving requests. You'll also want to use keepalive connections
        for HTTP connections, so consider setting the <a href='/docs/protocols/http'><code>defaultResponse</code></a>
        to make all <code>Connection</code> headers as <code>Keep-Alive</code>. As long as you set up each <code>mb</code>
        instance with the same configuration, you can run multiple instances behind a load balancer (they should all
        share the same volume for the <code>--datadir</code> option). A common
        strategy is to set up a <a href='/docs/api/proxies'>proxy</a> in <code>proxyAlways</code> or <code>proxyTransparent</code> mode
        and to capture the downstream latency by using the <code>addWaitBehavior</code> field to the proxy.
        When you replay the saved responses, they will add the perform with roughly the same latency the
        downstream services had.</dd>

        <dt>Why did you misspell impostor?</dt>
        <dd>mountebank is not an educated man, having spent the waking hours of his
          youth caring for the poor and the sick.</dd>

      </dl>

<% include _footer %>
